package com.itcast.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAdvice {
    @Pointcut("execution(int com.itcast.dao.AccountDao.update())")
    private void  pt(){}

    @Around("pt()")
    public Object method (ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("1");
        Object obj=pjp.proceed();

        System.out.println(obj);
        return obj;
    }
}
